function confirmEnding(str, target) {
return str.slice(str.length-target.length,str.length)==target;
}

console.log(confirmEnding("Bastian", "n"));
 let str1='hello';
 console.log(str1.indexOf('o'))
